<?php

namespace app\common\model;

/**
 * 用户租房账单
 */
class UserHouseBill extends BaseModel
{

    // 表名,不含前缀
    protected $name = 'user_house_bill';
    // 自动写入时间戳字段
    protected $autoWriteTimestamp = false;
    // 定义时间戳字段名
    protected $createTime = false;
    protected $updateTime = false;

    public function addBill($userHouseId, $bill)
    {
        $this->where("user_house_id", $userHouseId)->delete();
        foreach ($bill as $key => $value) {
            $value["user_house_id"] = $userHouseId;
            $this->insert($value);
        };
    }

}
